package com.qtt.app.mapper;

import com.qtt.app.entity.AppMyCoupon;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppMyCouponMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMyCoupon record);

    int insertSelective(AppMyCoupon record);

    AppMyCoupon selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMyCoupon record);

    int updateByPrimaryKey(AppMyCoupon record);

    List<AppMyCoupon> getCouponByUserId(@Param("userId") Long userId);

    @Select("SELECT coupon_id FROM app_coupon WHERE coupon_number = #{couponNumber}")
    Integer getIdByCouponNumber(@Param("couponNumber") String couponNumber);
}